Skip to content

Add abstract BaseImageFont class#9595

Merged
radarhere merged 3 commits into
python-pillow:mainfrom
radarhere:baseimagefont
Jun 18, 2026
Merged

Add abstract BaseImageFont class#9595
radarhere merged 3 commits into
python-pillow:mainfrom
radarhere:baseimagefont

Conversation

@radarhere

Copy link
Copy Markdown
Member

imageFont's ImageFont, FreeTypeFont and TransposedFont are all possible classes that can be used in ImageDraw or ImageText, and all share getbbox(), getmask() and getlength().

Let's formalize this by actually making them all inherit from a common class. For want of a better idea, I've named this BaseImageFont.

@radarhere radarhere force-pushed the baseimagefont branch 3 times, most recently from 2a6350e to 5f4b2e0 Compare April 29, 2026 03:54
Comment thread src/PIL/ImageDraw.py Outdated
@hugovk hugovk changed the title Added abstract BaseImageFont class Add abstract BaseImageFont class Jun 17, 2026
radarhere and others added 2 commits June 18, 2026 10:02
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
@radarhere radarhere merged commit d136509 into python-pillow:main Jun 18, 2026
53 checks passed
@radarhere radarhere deleted the baseimagefont branch June 18, 2026 00:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants